(defun primep (n)
  (cond ((<= n 3) t)
	((zerop (mod n 2)) nil)
	(t (loop 
	      for i = 3 then (+ i 2)
	      until (> i (floor (sqrt n)))
	      when (zerop (mod n i)) 
	      do (return nil) 
	      finally (return t)))))


(defun pfsquarep(x)
  (let (( root (sqrt x)))
    (zerop (- (floor root) root))))

(defun decomp (n)
  (loop for i from 2 to (- n 2)
       when (and (primep i)
		 (zerop (mod (- n i) 2))
		 (pfsquarep (/ (- n i) 2)))
       do (return t)
       finally (return nil)))

(defun probl46()
  (loop  for j from 1 to 10000
     for i = 9 then (+ i 2)
     when (and (not (primep i)) (not (decomp i)))
     do (return i)))